package jou.cs.configurator;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class CONST {
    public static final int PAGE_SIZE = 10;

    public static final long COMMENT = 0L;
    public static final long POST = 1L;

    public static final int CLICK = 5;
    public static final int COMT = 30;
    public static final int QUS = 25;

    @Getter
    @AllArgsConstructor
    public enum PlaceTrend {
        CLICK("click", 10),
        COMMENT("comment", 20),
        LIKE("like", 30),
        SHARE("share", 40);

        private final String type;
        private final Integer step;

        // 判断是否包含
        public static boolean contains(String type) {
            for (PlaceTrend trend : PlaceTrend.values()) {
                if (trend.getType().equals(type)) {
                    return true;
                }
            }
            return false;
        }

        // 通过字符串获取step
        public static int getStep(String type) {
            if (!contains(type)) return 0;
            for (PlaceTrend trend : PlaceTrend.values()) {
                if (trend.getType().equals(type)) {
                    return trend.getStep();
                }
            }
            return 0;
        }

    }
}
